<script setup>
const props = defineProps({
  moment: {
    type: Object,
    required: true,
  },
})
</script>

<template>
  <div class="moment-card">
    <div class="moment-header">
      <div class="moment-author">
        <i class="fas fa-user-circle"></i>{{ props.moment.author }}
        <span class="moment-label" v-for="(label, index) in props.moment.labels" :key="index"
          >#{{ label }}
        </span>
      </div>
      <!-- <span><i class="far fa-calendar"></i> {{ props.moment.date }}</span> -->
    </div>
    <p class="moment-context">{{ props.moment.context }}</p>
    <div class="moment-footer">
      <span><i class="fas fa-heart"></i> {{ props.moment.likeNums }} 点赞</span>
      <span><i class="fas fa-comment"></i> {{ props.moment.commentNums }} 评论</span>
    </div>
  </div>
</template>

<style scoped>
/* 朋友圈卡片 */
.moment-card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--border-radius);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  padding: 25px;
  transition: var(--transition);
}

.moment-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(var(--primary-rgb), 0.5);
}

.moment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  align-items: center;
}

.moment-author {
  font-weight: 600;
  color: var(--primary-light);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.moment-author i {
  color: var(--secondary);
}

.moment-label {
  color: var(--gray);
  font-size: 15px;
  font-style: italic;
}

.moment-context {
  max-height: 200px;
  color: var(--light);
  line-height: 1.9;
  margin-bottom: 15px;
  font-size: 18px;
  padding-left: 30px;
  overflow: auto;
  border-left: 2px solid var(--primary);
}

.moment-footer {
  display: flex;
  gap: 25px;
  color: var(--gray);
  font-size: 15px;
  padding-left: auto;
}

.moment-footer span {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.moment-footer span:hover {
  color: var(--secondary);
}

.moment-footer i {
  color: var(--secondary);
}

@media (max-width: 1100px) {
  .moment-card {
    height: auto;
    flex-direction: column;
  }
}
</style>
